package com.niiwoo.civet.mobile.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.niiwoo.activity.stage.service.prize.ActivityPrizeDubboService;
import com.niiwoo.civet.account.dto.common.BankCardDTO;
import com.niiwoo.civet.account.dto.common.BankTypeDTO;
import com.niiwoo.civet.account.dto.common.WithdrawOrderDTO;
import com.niiwoo.civet.account.dto.request.CheckFileConfirmRequestDTO;
import com.niiwoo.civet.account.dto.request.SubmitWithdrawRequestDTO;
import com.niiwoo.civet.account.dto.request.WithdrawOrderQueryRequest;
import com.niiwoo.civet.account.dto.response.AccountBaseResponse;
import com.niiwoo.civet.account.dto.response.WithdrawOrderResponseDTO;
import com.niiwoo.civet.account.dto.response.WithdrawT0CheckResponse;
import com.niiwoo.civet.account.enums.WithdrawAutoType;
import com.niiwoo.civet.account.enums.WithdrawBusinessTypeEnum;
import com.niiwoo.civet.account.service.AccountDubboService;
import com.niiwoo.civet.account.service.CheckFileConfirmDubboService;
import com.niiwoo.civet.account.service.WithdrawDubboService;
import com.niiwoo.civet.account.service.bankcard.BankCardDubboService;
import com.niiwoo.civet.mobile.vo.common.BankCardVO;
import com.niiwoo.civet.mobile.vo.common.BankTypeVO;
import com.niiwoo.civet.mobile.vo.common.FormVO;
import com.niiwoo.civet.mobile.vo.common.UserAccountVO;
import com.niiwoo.civet.mobile.vo.request.withdraw.SubmitWithdrawRequestVO;
import com.niiwoo.civet.mobile.vo.request.withdraw.WithdrawT0EnableCheckRequestVO;
import com.niiwoo.civet.mobile.vo.response.CheckFileConfirmRequestVO;
import com.niiwoo.civet.mobile.vo.response.withdraw.*;
import com.niiwoo.civet.trade.constant.PlatformConstant;
import com.niiwoo.civet.trade.dto.common.ProjectBorrowerPlanDTO;
import com.niiwoo.civet.trade.dto.common.ProjectBorrowerSummaryDTO;
import com.niiwoo.civet.trade.enums.TradeConfigEnum;
import com.niiwoo.civet.trade.service.configure.TradeConfigDubboService;
import com.niiwoo.civet.trade.service.myloan.MyLoanDubboService;
import com.niiwoo.civet.user.dto.response.ValidUserForbidResponseDTO;
import com.niiwoo.civet.user.enums.UserForbidTypeEnum;
import com.niiwoo.civet.user.service.UserForbidDubboService;
import com.niiwoo.tripod.base.utils.DateUtils;
import com.niiwoo.tripod.lanmao.component.LanMaoGatewayService;
import com.niiwoo.tripod.lanmao.enums.UserDeviceEnum;
import com.niiwoo.tripod.lanmao.enums.UserRoleEnum;
import com.niiwoo.tripod.lanmao.enums.WithdrawFormEnum;
import com.niiwoo.tripod.lanmao.enums.WithdrawTypeEnum;
import com.niiwoo.tripod.lanmao.request.WithdrawRequest;
import com.niiwoo.tripod.lanmao.response.LanMaoGatewayDTO;
import com.niiwoo.tripod.provider.dto.response.PageResponseDTO;
import com.niiwoo.tripod.web.annotation.AuthIgnore;
import com.niiwoo.tripod.web.util.PrincipalContext;
import com.niiwoo.tripod.web.vo.Empty;
import com.niiwoo.tripod.web.vo.PageResponseVO;
import com.niiwoo.tripod.web.vo.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.Assert;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;
import java.math.BigDecimal;
import java.util.*;
import java.util.stream.Collectors;

/**
 * Created by xiaoyaocai on 2017/12/18.
 */
@Slf4j
@RestController
@RequestMapping("/checkFileConfirm")
@Api(tags = "对账文件确认", description = "/checkFileConfirm")
public class CheckFileConfirmController {

    @Autowired
    private LanMaoGatewayService lanMaoGatewayService;

    @Reference(version = "1.0.0")
    private CheckFileConfirmDubboService checkFileConfirmDubboService;


    /**
     * 对账确认
     * @return
     */
    @PostMapping("/checkConfirm")
    @ApiOperation("对账确认")
    public Empty checkConfirm(@RequestBody @Valid CheckFileConfirmRequestVO checkFileConfirmRequestVO){
        CheckFileConfirmRequestDTO checkFileConfirmRequestDTO = new CheckFileConfirmRequestDTO();
        checkFileConfirmRequestDTO.setDetail(checkFileConfirmRequestVO.getDetail());
        checkFileConfirmRequestDTO.setFileDate(DateUtils.formatDate(checkFileConfirmRequestVO.getFileDate(), DateUtils.DATE_FORMAT));
        checkFileConfirmDubboService.checkFileConfirm(checkFileConfirmRequestDTO);
        return Empty.getInstance();
    }

}
